#!/bin/bash
let i=0
let j=1
while [ $j -lt 100 ] ; do
    echo "Level: $j"
    ./timeout.sh -t 60 java -cp build/ client 130.237.218.85 7781 $j nographical | grep -i "correct" > /dev/null
    if [ "$?" -eq "0" ] ; then
        echo "Solution found"
        let i=i+1
    else    
        echo "No solution found"
    fi

    let j=j+1
done

echo "Total solved: $i"
